package com.mall.implementation;

import java.util.ArrayList;

import com.mall.core.Receipt;

public class LedgerImpl  implements com.mall.core.Ledger{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
private ArrayList<Receipt> purchasereceipt;
private ArrayList<Receipt> returnreceipt;
	@Override
	public Receipt getPurcahseRecipt(int id) {
		Receipt preceipt = null;
	for(Receipt receipt: purchasereceipt){
		if(receipt.getId()==id){
			preceipt= receipt;
		}
	}
	return preceipt;
	}

	@Override
	public void setPurchaseRecipt(Receipt recipt) {
	 purchasereceipt.add(recipt);
		
	}

	@Override
	public Receipt getReturnRecipt(int id) {
		Receipt preceipt = null;
		for(Receipt receipt: returnreceipt){
			if(receipt.getId()==id){
				preceipt= receipt;
			}
		}
		return preceipt;
	}

	@Override
	public void setReturnRecipt(ArrayList<Receipt> recipt) {
		this.returnreceipt=recipt;
		
	}

	@Override
	public ArrayList<Receipt> getallPurcahseRecipt(int storeid) {
	
		return purchasereceipt;
	}

	@Override
	public ArrayList<Receipt> getallReturnRecipt(int storeid) {

		return returnreceipt;
	}

	@Override
	public void setReturnRecipt(Receipt recipt) {
		returnreceipt.add(recipt);
		
	}

	@Override
	public void setPurchaseRecipt(ArrayList<Receipt> recipt) {
		purchasereceipt=recipt;
		
	}

}
